#include <S32FILE.H>
#include <CoeMain.h>
#include <uikon.hrh>
#include <APGCLI.H>

#include "AppListSettings.h"
#include "Utils.h"
#include "Uids.h"
#include "Logger.h"

TAppListSettings::~TAppListSettings()
{
}

void TAppListSettings::SaveSettingsL()
{
	CDictionaryStore *iniFile = CDictionaryFileStore::OpenLC(CCoeEnv::Static()->FsSession(), KSettingsFileName, KUidMyApp);
	
	Utils::SaveIntL(iniFile, EAppSortType, iAppSortType);
	Utils::SaveIntL(iniFile, EShowHiddenApps, iShowHiddenApps);
	Utils::SaveIntL(iniFile, EShowApps, iShowApps);
//
	CleanupStack::PopAndDestroy();//-iniFile
}


void TAppListSettings::LoadSettingsL()
{
	CDictionaryStore* iniFile = CDictionaryFileStore::OpenLC(CCoeEnv::Static()->FsSession(), KSettingsFileName, KUidMyApp);

	Utils::LoadIntL(iniFile, EAppSortType, iAppSortType, ESortByName);
	Utils::LoadIntL(iniFile, EShowHiddenApps, iShowHiddenApps, EFalse);
	Utils::LoadIntL(iniFile, EShowApps, iShowApps, ETrue);

	CleanupStack::PopAndDestroy();//-iniFile
}
